package rensoft.portfolio.client.lib.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DialogBox.Caption;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;

import rensoft.gwt.client.view.View;



public class ClosableDialogCaption extends View<Widget> implements Caption {

  interface Binder extends UiBinder<Widget, ClosableDialogCaption> {}

  private static Binder uiBinder = GWT.create(Binder.class);

  @UiField
  HTML closeButton;

  private DialogBox dialog;

  public ClosableDialogCaption() {
    initWidget(uiBinder.createAndBindUi(this));
  }

  public String getHTML() {
    return "";
  }

  public String getText() {
    return "";
  }

  public void setDialog(DialogBox dialog) {
    this.dialog = dialog;
  }

  public void setHTML(SafeHtml html) {}

  public void setHTML(String html) {}

  public void setText(String text) {}

  @UiHandler("closeButton")
  void onClick(ClickEvent e) {
    dialog.hide();
  }

}
